[PATCH] XCB: Remove extra xcb_randr_select_input() calls
authorVlad Zahorodnii <vlad.zahorodnii@kde.org>
Sun, 27 Jul 2025 12:58:31 +0000 (15:58 +0300)
committerPatrick Franz <deltaone@debian.org>
Tue, 2 Sep 2025 19:04:45 +0000 (21:04 +0200)
commit533d53a622753677b28e839ad907fda4eaf0b3c2
tree5581fb349a8ef9ad2c19f0653a80e46b8c95c6e1
parent60323e1e3e4288acf43bca4a21fe2e15056c761c
[PATCH] XCB: Remove extra xcb_randr_select_input() calls

This fixes high CPU usage in kwin.

If there is a ConfigureNotify event for the root window, QtXCB will
call xcb_randr_select_input(). The problem is that the X server may send
an output change event in response to xcb_randr_select_input().

When kwin sees that output change event, it will process the event and
it can update its override redirect windows, which can produce a few
ConfigureNotify events for the root window and make kwin get stuck in an
update loop.

Since the QXcbConnection constructor already subscribes to the RandR
events, these xcb_randr_select_input() function calls can be removed.
Also, `true` is not a valid argument for xcb_randr_select_input(). It
expects a mask of events to listen. For what it's worth, `true`
corresponds to XCB_RANDR_NOTIFY_MASK_SCREEN_CHANGE = 1, which
xrandrSelectEvents() already subscribes to.

Pick-to: 6.10 6.9 6.8
Change-Id: I950a0a6e2e34822ac3da8cd69b96670e4bf4b07d
Reviewed-by: Liang Qi <liang.qi@qt.io>
Gbp-Pq: Name upstream_fix_high_cpu_load_kwin_x11.diff
src/plugins/platforms/xcb/qxcbscreen.cpp